Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally allow overwriting of the hooks file name #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

m-gora
Copy link

@m-gora m-gora commented Oct 11, 2021

In one of my teams my colleagues discovered a problem:
If you run a multi-module project, the script initializes a hook for each module which you might have executed.
E.g. if you ran the project on root level, but at a later time only a sub module, to save some time compiling and testing...

This means the check will be executed for each module which had a maven run beforehand.
In order to circumvent that, a configuration option where you'd be able to override the generated script's name would be beneficial.

I provided a PR adding a config option which will be taken in favour of the artifactId if it is set.

Additionally I formatted the code with the google formatter ;)

@@ -175,11 +183,15 @@ private String preCommitHookBaseScriptCall() {
return calls;
}

private String getHookScriptName() {
return Optional.ofNullable(this.hookScriptName).orElseGet(this::artifactId);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the actual change introduced.

@reda-alaoui
Copy link
Member

Please remove any change (formatting, final keyword addition, ...) that does not directly pertain to the goal of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants